package com.zimug.boot.launch.redis;


import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.util.Optional;

@SpringBootTest
public class RedisConfigTest4 {

    @Resource
    PersonRepository personRepository;

    @Test
    public void testHashPutAll(){
        Person rand = new Person("zimug", "汉神");
        rand.setAddress(new Address("杭州", "中国"));

        personRepository.save(rand);
        Optional<Person> op =  personRepository.findById(rand.getId());
        Person ps = op.get();

        personRepository.count();
        personRepository.delete(rand);

    }
}